import Mock from 'mockjs'
import Pick from './utils'

const { Random } = Mock

const mock1 = {
  color: () => Random.color(),
  type: () => 'rectangle',
  bio: () => Random.cparagraph(),
  name: () => '苹果',
}

const mock2 = {
  color: () => Random.color(),
  type: () => 'rectangle',
  bio: () => Random.cparagraph(),
  name: () => '香蕉',
}

const mock3 = {
  color: () => Random.color(),
  type: () => 'rectangle',
  bio: () => Random.cparagraph(),
  name: () => '葡萄',
}

const mock4 = {
  color: () => Random.color(),
  type: () => 'rectangle',
  bio: () => Random.cparagraph(),
  name: () => '草莓',
}

const mock5 = {
  color: () => Random.color(),
  type: () => 'polygon',
  bio: () => Random.cparagraph(),
  name: () => '梨',
}

const mock6 = {
  color: () => Random.color(),
  type: () => 'polygon',
  bio: () => Random.cparagraph(),
  name: () => '金果',
}

const mock7 = {
  color: () => Random.color(),
  type: () => 'polygon',
  bio: () => Random.cparagraph(),
  name: () => '柿子',
}

const mock8 = {
  color: () => Random.color(),
  type: () => 'polygon',
  bio: () => Random.cparagraph(),
  name: () => '西瓜',
}

const mock9 = {
  color: () => Random.color(),
  type: () => 'keypoint',
  bio: () => Random.cparagraph(),
  name: () => '人体',
  points: () => [
    {
      name: '头',
      coordinate: [0.5, 0],
      color: Random.color(),
    },
    {
      name: '颈',
      coordinate: [0.5, 0.15],
      color: Random.color(),
    },
    {
      name: '右肩',
      coordinate: [0.25, 0.15],
      color: Random.color(),
    },
    {
      name: '右肘',
      coordinate: [0.125, 0.25],
      color: Random.color(),
    },
    {
      name: '右腕',
      coordinate: [0, 0.375],
      color: Random.color(),
    },
    {
      name: '左肩',
      coordinate: [0.75, 0.15],
      color: Random.color(),
    },
    {
      name: '左肘',
      coordinate: [0.875, 0.25],
      color: Random.color(),
    },
    {
      name: '左腕',
      coordinate: [1, 0.375],
      color: Random.color(),
    },
    {
      name: '右腿',
      coordinate: [0.375, 0.5],
      color: Random.color(),
    },
    {
      name: '右膝',
      coordinate: [0.25, 0.75],
      color: Random.color(),
    },
    {
      name: '右踝',
      coordinate: [0.25, 1],
      color: Random.color(),
    },
    {
      name: '左腿',
      coordinate: [0.625, 0.5],
      color: Random.color(),
    },
    {
      name: '左膝',
      coordinate: [0.75, 0.75],
      color: Random.color(),
    },
    {
      name: '左踝',
      coordinate: [0.75, 1],
      color: Random.color(),
    },
  ],
  lines: [
    [0, 1],
    [1, 2],
    [2, 3],
    [3, 4],
    [1, 5],
    [5, 6],
    [6, 7],
    [2, 8],
    [8, 9],
    [9, 10],
    [8, 11],
    [5, 11],
    [11, 12],
    [12, 13],
  ],
}

export default () => Pick([mock1, mock2, mock3, mock4, mock5, mock6, mock7, mock8, mock9])
